package com.mall.user.service.impl;

import com.mall.entity.UserRole;
import com.mall.user.mapper.UserRoleMapper;
import com.mall.user.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;


    @Override
    public int addUserRole(UserRole userRole) {
        userRole.setIsDeleted(0);
        userRole.setCreateTime(new Date());
        userRole.setUpdateTime(new Date());
        int insert = userRoleMapper.insert(userRole);
        return insert;
    }
}
